home *** CD-ROM | disk | FTP | other *** search
/ Kit PC World De Ampliacion De Windows 95 / Kit PC World de ampliacion de Windows 95.iso / internet / sweeper / samples / olecon~1 / include / strcoll.h < prev    next >
Text File  |  1995-11-25  |  2KB  |  65 lines

  1. //=--------------------------------------------------------------------------=
  2. // StringsColl.H
  3. //=--------------------------------------------------------------------------=
  4. // Copyright  1995  Microsoft Corporation.  All Rights Reserved.
  5. //
  6. // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF 
  7. // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO 
  8. // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A 
  9. // PARTICULAR PURPOSE.
  10. //=--------------------------------------------------------------------------=
  11. //
  12. // contains the definitions for the various string collections we'll use
  13. //
  14. #ifndef _STRINGSCOLL_H_
  15.  
  16. #include "CommDlgInterfaces.H"
  17.  
  18.  
  19.  
  20. //=--------------------------------------------------------------------------=
  21. // the CStringsCollection class basically works with a safearray to expose the
  22. // collection, and uses the safearray functions to maniplate it.
  23. //=--------------------------------------------------------------------------=
  24. // NOTES: 9.95 - this collection assumes that the safearray lbound is
  25. //        zero!
  26. //=--------------------------------------------------------------------------=
  27. //
  28. class CStringCollection {
  29.  
  30.   public:
  31.     // a couple of methods that are common
  32.     //
  33.     STDMETHOD(get_Count)(THIS_ long FAR* pcStrings);
  34.     STDMETHOD(get_Item)(THIS_ long lIndex, BSTR FAR* pbstrItem);
  35.     STDMETHOD(get__NewEnum)(THIS_ IUnknown * FAR* ppUnkNewEnum);
  36.  
  37.     CStringCollection(SAFEARRAY *);
  38.     virtual ~CStringCollection();
  39.  
  40.   protected:
  41.     // what the collection will work with.
  42.     //
  43.     SAFEARRAY *m_psa;
  44. };
  45.  
  46. class CStringDynaCollection : public CStringCollection {
  47.  
  48.   public:
  49.     // in addition to the CStringCollection methods, we'll have
  50.     //
  51.     STDMETHOD(put_Item)(THIS_ long lIndex, BSTR bstrItem);
  52.     STDMETHOD(Add)(THIS_ BSTR bstrNew);
  53.     STDMETHOD(Remove)(THIS_ long lIndex);
  54.  
  55.     CStringDynaCollection(SAFEARRAY *);
  56.     virtual ~CStringDynaCollection();
  57.  
  58. };
  59.  
  60.  
  61. #define _STRINGSCOLL_H_
  62. #endif // _STRINGSCOLL_H_
  63.  
  64.  
  65.